Conventional operating systems implement a few different execution models to manage foreground and background work of applications. Examples of processing tasks that may be considered to be foreground work include, but are not limited to, presenting a graphical user interface, responding to a user input, and any other type of work related to user interaction. Examples of processing tasks that may be considered to be background work include, but are not limited to, downloading and installing software updates, synchronizing with a server, and any other type of work that may not involve user attention.
In a first model, any number of applications are allowed to execute concurrently, both in the foreground and in the background, and compete for resources such as processor cycles and memory. This model is commonly implemented on desktop and laptop computers.
In a second model, all applications are blocked from execution except an “active” application, namely, an application with which a user is actively interacting. This model is commonly implemented on mobile devices, where, at any given time, a user typically interacts with a single application that is displayed on full screen.
In a third model, foreground work and background work for the same application are treated as being mutually exclusive, so that an application executing in the foreground is not scheduled to do any background work at the same time, and vice versa.
In a fourth model, an application may be separately instantiated for foreground work and for background work, with the two instances executing concurrently and competing for resources.